import request from '@/utils/request'

export default{
    //添加课程
    addCourseInfo(courseInfo){
        return request({
            url:'/eduservice/course/savecourse',
            method:'post',
            data:courseInfo
        })
      
    },
    //查询所有讲师
    getTeacherList(){
        return request({
            url:'/eduservice/teacher/findAll',
            method:'get',
          

        })
    },
    //根据课程id查询课程信息
    getCourseById(courseId){
        return request({
            // url:'/eduservice/course/getCourse/'+courseId,
            url:`/eduservice/course/getCourse/${courseId}`,
            method:'get'
        })
    },


    //修改课程信息
    updateCourseInfo(courseInfo){
        return request({
            url:'/eduservice/course/updateCourseInfo',
            method:'post',
            data:courseInfo
        })
    },

    //课程确认信息显示
    getPublishCourseInfo(courseId){
        return request({
            url:`/eduservice/course/publicCourseVo/${courseId}`,
            method:'get',
        })

    },

    //发布课程
    publishCourse(courseId){    
        return request({
            url:'/eduservice/course/publishCourse/'+courseId,
            method:'post'
        })
    },

     //1.讲师列表 （条件查询分页）
    getCourseList(page,limit,courseQuery){
        return request({
            url:`/eduservice/course/queryCourse/${page}/${limit}/`,
            method:'post',
            data:courseQuery
        })
    },

    //删除课程 章节 课时 描述
    delCourseBycourseId(courseId){
        return request({
            url:`/eduservice/course/${courseId}`,
            method:'delete'
        })
    }
}